package com.gsk.test123.controller;


import com.gsk.test123.service.DataTimeParamService;
import com.gsk.test123.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jrw
 * @since 2018-06-21
 */
@RestController
public class UsersController {
    @Autowired
    private UsersService usersService;
    @Autowired
    private DataTimeParamService dataTimeParamService;
    @GetMapping("/test1")
    public Object test1(){
        return usersService.getusers1();
    }
    @PostMapping("/test2")
    public void test2(){
         usersService.insetUsers2();
    }
    @GetMapping("/test3")
    public Object test3(){
        Map map = new HashMap();
        map.put("test","ok");
        return map;
    }

    @GetMapping("/test4")
    public Object test4(){

        return dataTimeParamService.findall();
    }
}

